#ifndef CRITTERS_H
#define CRITTERS_H

class critter
{
 public:
 hgeSprite* spr_critter_attack;   //Attack layer is generally static. When the critter attacks, the animation is played on a loop until the critter is no longer attacking
 hgeSprite* spr_critter_movement; //Plays the animation while the critter is moving. Play speed is directly attached to actual speed.
 char*     critter_name;
 float     X_Position,     Y_Position;
 float     X_Velocity,     Y_Velocity;
 float X_Acceleration, Y_Acceleration;
 float health, min_health, max_health, health_regen; //The unit's base health (between min/max) and regeneration
 //Describse the resistance of different types of attacks. A unit high in Low_Caliber_Res will take less damage from bullets of low_caliber.
 float Phys_Res, Fire_Res, Poison_Res, Para_Res, Ionic_Res, Pierce_Res, Low_Caliber_Res;
 float weight, min_weight, max_weight;
 float speed,  min_speed, max_speed;
 //Hitboxes ABC
 float HitBoxA_Radius, HitBoxA_Damage_Factor, offsetA_X, offsetA_Y;
 float HitBoxB_Radius, HitBoxB_Damage_Factor, offsetB_X, offsetB_Y;
 float HitBoxC_Radius, HitBoxC_Damage_Factor, offsetC_X, offsetC_Y;
 //AI & Abilities
 bool Burrow, Sprint, Reanimate, Berserk, Explode, Split, Sappervore, Chameleon, Projectile;
 //Burrow:     Able to dig into the ground. Damaged only by explosives
 //Sprint:     Able to gain a short burst of speed
 //Reanimate:  When health reaches 0, the critter dies, but does not lose collision. If critter is further shot, then it perma-dies. Otherwise, the critter is reanimated with full health and continues the assault.
 //Berserk:    A critter will receive a burst of speed, health, and damge for a time, afterwards, it'll lose half damage, speed, and resistances for a time.
 //Explode:    Explodes on death
 //Split:      Splits into a number of enemies upon death.
 //Sapprovore: Attacted to powerups and resources, will eat them and level up if enough is consumed.
 //Chameleon:  Can lower it's sprite's alpha levels for a time.
 //Projectile: Uses an inventory gun to "Fire" something
 
 //Functions
 critter();
 void spawn_creature(float XPos, float YPos, float XVel, float YVel, float XAcc, float YAcc, critter* base_critter);
 void update(float delta_time);
 void render();
};

critter::critter() {}

void critter::spawn_creature(float XPos, float YPos, float XVel, float YVel, float XAcc, float YAcc, critter* base_critter)
{
/*
 //AI & Abilities (Implement later)
 bool Burrow, Sprint, Reanimate, Berserk, Explode, Split, Sappervore, Chameleon, Projectile;
*/
 spr_critter_attack    = base_critter->spr_critter_attack;
 spr_critter_movement  = base_critter->spr_critter_movement;
 critter_name          = base_critter->critter_name;
 X_Position            = XPos; Y_Position     = YPos;
 X_Velocity            = XVel; Y_Velocity     = YVel;
 X_Acceleration        = XAcc; Y_Acceleration = YAcc;
 min_health            = base_critter->min_health;
 max_health            = base_critter->max_health;
 health                = hge->Random_Float(min_health, max_health);
 health_regen          = base_critter->health_regen;
 Phys_Res              = base_critter->Phys_Res;
 Fire_Res              = base_critter->Fire_Res;
 Poison_Res            = base_critter->Poison_Res;
 Para_Res              = base_critter->Para_Res;
 Ionic_Res             = base_critter->Ionic_Res;
 Pierce_Res            = base_critter->Pierce_Res;
 Low_Caliber_Res       = base_critter->Low_Caliber_Res;
 min_weight            = base_critter->min_weight;
 max_weight            = base_critter->max_weight;
 weight                = hge->Random_Float(min_weight, max_weight);
 min_speed             = base_critter->min_speed;
 max_speed             = base_critter->max_speed;
 speed                 = hge->Random_Float(min_speed, max_speed);
 HitBoxA_Radius        = base_critter->HitBoxA_Radius;
 HitBoxA_Damage_Factor = base_critter->HitBoxA_Damage_Factor;
 offsetA_X             = base_critter->offsetA_X;
 offsetA_Y             = base_critter->offsetA_Y; 
 HitBoxB_Radius        = base_critter->HitBoxB_Radius;
 HitBoxB_Damage_Factor = base_critter->HitBoxB_Damage_Factor;
 offsetB_X             = base_critter->offsetB_X;
 offsetB_Y             = base_critter->offsetB_Y; 
 HitBoxC_Radius        = base_critter->HitBoxC_Radius;
 HitBoxC_Damage_Factor = base_critter->HitBoxC_Damage_Factor;
 offsetC_X             = base_critter->offsetC_X;
 offsetC_Y             = base_critter->offsetC_Y;   
}

void critter::update(float delta_time)
{
     
}

void critter::render()
{
     
}

#endif
